const { Command } = require('commander');
const program = new Command();
program.version('1.0.0');

program
  .option('-d, --debug', 'output extra debugging')
  .option('-s, --small', 'small pizza size')
  .option('-p, --pizza-type <type>', 'flavour of pizza')
  // []为可选
  .option('-c, --cheese [type]', 'Add cheese with optional type')
  // 设置选项默认值
  .option('-c, --cheese <type>', 'add the specified type of cheese', 'blue');

// 处理参数，没有被使用的选项会存放在program.args数组中
program.parse(process.argv);
console.log('program', program);
console.log('program', program.debug);
console.log('program small', program.small);
